GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( cc0130...b571b0 )
by Benjamin
01:46
created

stateGetter.js ➔ ???   B

Complexity

Conditions 6
Paths 3

Size

Total Lines 21

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 6
c 2
b 0
f 0
nc 3
dl 0
loc 21
rs 8.7624
nop 4
1
/*
2
* central function to retrieve state from reducer
3
* used inside of mapStateToProps by grid and other plugins
4
* @returns {object} state
5
6
* if a dynamic reducerKey is passed, it will favor that key
7
* over the build in grid keys
8
9
*/
10
11
export const stateGetter = (state, props, key, entry) => {
12
13
    if (props
14
        && props.reducerKeys
15
        && Object.keys(props.reducerKeys).length > 0
16
        && props.reducerKeys[key]) {
17
18
        const dynamicKey = props.reducerKeys[key];
19
        const dynamicState = get(state, dynamicKey, entry);
20
21
        return dynamicState;
22
    }
23
24
    const val = get(state, key, entry);
25
26
    if (val) {
27
        return val;
28
    }
29
30
    return null;
31
};
32
33
export const get = (state, key, entry) => state
34
    && state[key]
35
    && state[key].get
36
    && state[key].get(entry)
37
        ? state[key].get(entry)
38
        : null;
39